package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the CONTRACT_CATEGORY database table.
 * 
 */
@Entity
@Table(name="CONTRACT_CATEGORY")
@NamedQuery(name="ContractCategory.findAll", query="SELECT c FROM ContractCategory c")
public class ContractCategory implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CONTRACT_CATEGORY_CONCAID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CONTRACT_CATEGORY_CONCAID_GENERATOR")
	@Column(name="CONCA_ID")
	private long concaId;

	@Column(name="CONCA_FOUNDTIME")
	private Timestamp concaFoundtime;

	@Column(name="CONCA_NAME")
	private String concaName;

	@Column(name="CONCA_PERSON")
	private String concaPerson;

	@Column(name="CONCA_UPDATETIME")
	private Timestamp concaUpdatetime;

	//bi-directional many-to-one association to ContractAdministration
	@OneToMany(mappedBy="contractCategory")
	@JSONField(serialize=false)
	private List<ContractAdministration> contractAdministrations;

	public ContractCategory() {
	}

	public long getConcaId() {
		return this.concaId;
	}

	public void setConcaId(long concaId) {
		this.concaId = concaId;
	}

	public Timestamp getConcaFoundtime() {
		return this.concaFoundtime;
	}

	public void setConcaFoundtime(Timestamp concaFoundtime) {
		this.concaFoundtime = concaFoundtime;
	}

	public String getConcaName() {
		return this.concaName;
	}

	public void setConcaName(String concaName) {
		this.concaName = concaName;
	}

	public String getConcaPerson() {
		return this.concaPerson;
	}

	public void setConcaPerson(String concaPerson) {
		this.concaPerson = concaPerson;
	}

	public Timestamp getConcaUpdatetime() {
		return this.concaUpdatetime;
	}

	public void setConcaUpdatetime(Timestamp concaUpdatetime) {
		this.concaUpdatetime = concaUpdatetime;
	}

	public List<ContractAdministration> getContractAdministrations() {
		return this.contractAdministrations;
	}

	public void setContractAdministrations(List<ContractAdministration> contractAdministrations) {
		this.contractAdministrations = contractAdministrations;
	}

	public ContractAdministration addContractAdministration(ContractAdministration contractAdministration) {
		getContractAdministrations().add(contractAdministration);
		contractAdministration.setContractCategory(this);

		return contractAdministration;
	}

	public ContractAdministration removeContractAdministration(ContractAdministration contractAdministration) {
		getContractAdministrations().remove(contractAdministration);
		contractAdministration.setContractCategory(null);

		return contractAdministration;
	}

}